package com.shigu.test;

import com.shigu.linkage.sdks.exceptions.LinkageException;
import com.shigu.linkage.sdks.requests.ConsumeSMSRequest;
import com.shigu.linkage.sdks.requests.SubMerchantRegistRequest;
import com.shigu.linkage.sdks.requests.TradeRequest;
import com.shigu.linkage.sdks.responses.ConsumeSMSResponse;
import com.shigu.linkage.sdks.responses.SubMerchantRegistResponse;
import com.shigu.linkage.sdks.responses.TradeResponse;
import org.junit.Test;

public class FirstTry {
    /**
     * 进件测试
     */
    @Test
    public void registTest() throws LinkageException {
        SubMerchantRegistRequest req=new SubMerchantRegistRequest();
        req.setMerchName("陶延清");
        req.setNickName("陶延清");
        req.setServicePhone("18768111596");
        req.setContacts("陶延清");
        req.setContactsTel("18768111596");
        req.setContactMobile("18768111596");
        req.setContactAdress("金沙世纪");
        req.setCategoryCode("205");
        req.setMerchantCode("46533031");
        req.setOutMerchantCode("2018020100002");
        req.setAccNo("6228480323052531113");
        req.setAccName("陶延清1");
        req.setAccType("D");
        req.setOpenBank("农业银行");
        req.setBankCode("ICBC");
        req.setAlliedBankCode("103331004266");
        req.setTradeRate("0.50");
        req.setRemitFee("2");
        req.setSettlePeriod("T0");
        req.setMerchantNotifyUrl("http://kjt01.hz.taeapp.com/callbacktest.htm");
        req.setCertNo("330501199106237313");
        req.setFastpayPointsTradeRate("0.50");
        SubMerchantRegistResponse res=req.exec();
        System.out.println(res.resultBody());
    }

    @Test
    public void sureTrade() throws LinkageException {
        TradeRequest req=new TradeRequest();
        req.setOrderNo("201801653312252");
        req.setSubMerchCode("123321");
        req.setAmount("123.21");
        req.setNotifyUrl("http://kjt01.hz.taeapp.com/callbacktest.htm");
        req.setSmsCode("1234");
        req.setCvv("123123");
        req.setExpireDate("0919");
        req.setChannelCode("fastSoopay");
        req.setCriditNo("123456789");
        req.setBankPhoneNo("18888888888");
        TradeResponse res=req.exec();
        System.out.println(res.resultBody());

    }

    @Test
    public void consumeSms() throws LinkageException {
        ConsumeSMSRequest req=new ConsumeSMSRequest();
        req.setAmount("100.00");
        req.setOrderNo("102155236512");
        req.setMerchCode("46533031");
        req.setSubMerchCode("123321");
        req.setGoodsName("百货商品");
        req.setChannelCode("fastSoopay");
        req.setTypeCode("T0");
        req.setNotifyUrl("http://kjt01.hz.taeapp.com/callbacktest.htm");
        req.setCriditNo("4581230174632051");
        req.setBankPhoneNo("18888971970");
//        req.setCvv("123312");
//        req.setExpireDate("0919");
        ConsumeSMSResponse res=req.exec();
        System.out.println(res.resultBody());
    }
}
